<script>
	import store from '@/public/store.js'
	export default {
		globalData: {
			imgurl: 'https://td.lszbg.com/public/uploads/h5/TanDianDaRen/', //FTP图片地址
			imgurlBwc: 'https://td.lszbg.com/public/uploads/h5/',
      baseUrl: store.state.baseUrl,
			//绑定上级
			// #ifdef MP-WEIXIN || H5
			bindSaveParentId: function(options) {
				console.log('推荐人ID和服务商ID', options)
				let that = this

				//绑定所属运营商
				let reseller_id = options.reseller_id.reseller_id || ''
				if (!reseller_id) {
					//运营商id不存在
				} else {
					uni.setStorageSync('reseller_id', reseller_id);

					let iftoken = uni.getStorageSync('token')
					let resellerid = uni.getStorageSync('reseller_id')

					//然后判断是否登录//登录了就绑定运营商ID
					if (!iftoken) {
						//没有登录
					} else {
						uni.request({
							url: store.state.baseUrl + '/api/user/bindResellerId',
							method: 'POST',
							data: {
								reseller_id: resellerid
							},
							header: {
								'authorization': uni.getStorageSync('token')
							},
							success: res => {},
							fail: (err) => {}
						})
					}
				}

				//先存储推荐人id
				let parent_Id = options.parent_id
				if (!parent_Id) {
					//邀请人id不存在
				} else {
					uni.setStorageSync('parent_id', parent_Id);

					let iftoken = uni.getStorageSync('token')
					let pidman = uni.getStorageSync('parent_id')

					//然后判断是否登录
					if (!iftoken) {
						//没有登录
					} else {
						//登录了就绑定推荐人
						uni.request({
							//存储父级id
							url: store.state.baseUrl + '/api/user/bindPid',
							method: 'POST',
							data: {
								parent_id: pidman
							},
							header: {
								'authorization': uni.getStorageSync('token')
							},
							success: res => {

							},
							fail: (err) => {

							}
						})
					}
				}
			},
			// #endif
		},
		onLaunch: function() {
			console.log('App Launch')
			// #ifdef MP-WEIXIN
			const appId = uni.getAccountInfoSync().miniProgram.appId;
			uni.setStorageSync('miniProgramAppId', appId);
			// #endif
			//获取客服链接
			this.$api.GetcustomerService({}).then(res => {
				uni.setStorageSync('customerServiceData', res.data.result)
			}).catch(err => {})
			//获取客服二维码
			this.$api.getCustomerService({}).then(res => {
				uni.setStorageSync('customerServiceErWeima', res.data.result)
			}).catch(err => {})
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style lang="scss">
  /* 注意要写在第一行，同时给style标签加入lang="scss"属性 */
  @import "uview-ui/index.scss";
	body {
		font-family: Helvetica Neue, Helvetica, sans-serif;
	}
  /* tabbar的css */
  .tabber{
    width: 100%;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: #FFFFFF;
    padding-bottom: constant(safe-area-inset-bottom);
    /* 兼容 iOS < 11.2 */
    padding-bottom: env(safe-area-inset-bottom);
    /* 兼容 iOS >= 11.2 */
  }
  /* 修改全局折叠面板样式 */
  .u-collapse-head {
    padding: 10rpx 0 !important;
    font-size: 24rpx !important;
  }
  .u-arrow-down-icon{
    margin-right: 2rpx !important;
  }


	image {
		vertical-align: bottom;
	}
  //uniapp样式控制溢出隐藏带省略号
  @mixin ellipsis($lines: 1) {
    overflow: hidden;
    word-break: break-all; /* 允许在单词内换行 */
    text-overflow: ellipsis; /* 超出部分省略号 */
    display: -webkit-box; /* 对象作为伸缩盒子模型显示 */
    -webkit-box-orient: vertical; /* 设置或检索伸缩盒对象的子元素的排列方式 */
    -webkit-line-clamp: $lines; /* 显示的行数 */
  }
  /* 使用 mixin */
  .ellipsis-one-line {
    @include ellipsis(1);
  }
  .ellipsis-two-line {
    @include ellipsis(2);
  }
	/deep/ scroll-view ::-webkit-scrollbar {
		display: none;
		width: 0;
		height: 0;
		color: transparent;
	}
  /* uni-ui 样式覆盖 */
  /* 覆盖uni-collapse的背景色 */
  .uni-collapse {
    background-color: transparent !important; /* 或者使用rgba(0,0,0,0)来实现透明背景 */
  }
  /* 如果需要覆盖子项的背景色，可以进一步细化 */
  .uni-collapse-item__wrap {
    background-color: transparent !important;
  }
  .uni-collapse-item__title-arrow {
    margin-right: 0 !important;
  }

	// 文字显示一行或多行
	.text-Omit {
		word-break: break-all;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		overflow: hidden;
	}

	//悬浮在底部的按钮-实心
	.bottom-btn-wrap {
		background-color: #ffffff;
		box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.1);
		position: fixed;
		bottom: 0;
    left: 0;
    right: 0;
		width: 100%;
		z-index: 99;
    padding-top:10rpx;
		padding-bottom: constant(safe-area-inset-bottom);
		/* 兼容 iOS < 11.2 */
		padding-bottom: env(safe-area-inset-bottom);
		/* 兼容 iOS >= 11.2 */
		.bottom-fixed-btn {
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 16rpx;

			.btn {
				flex: 1;
				display: flex;
				align-items: center;
				justify-content: center;
				height: 88rpx;
				line-height: 88rpx;
				border-radius: 200rpx;
				text-align: center;
				font-weight: bold;
				font-size: 32rpx;
			}

			.pay {
				background-color: #F97632;
				color: #ffffff;
			}

			.finish {
				background-color: #F2F2F2;
				color: #333333;
			}
		}
	}

	//悬浮在底部的按钮-空心
	.bottom-border-btn-wrap {
		background-color: #f4f4f4;
		box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.1);
		position: fixed;
		bottom: 0;
		width: 100%;
		z-index: 99;
		padding-bottom: constant(safe-area-inset-bottom);
		/* 兼容 iOS < 11.2 */
		padding-bottom: env(safe-area-inset-bottom);

		/* 兼容 iOS >= 11.2 */
		.bottom-fixed-btn {
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 16rpx;

			.btn {
				flex: 1;
				display: flex;
				align-items: center;
				justify-content: center;
				height: 88rpx;
				line-height: 88rpx;
				border-radius: 200rpx;
				text-align: center;
				font-weight: bold;
				font-size: 32rpx;
			}

			.addrz {
				background-color: #f4f4f4;
				color: #999999;
				border: 1px solid #999999;
			}
		}
	}

	//心跳动画
	@keyframes breathe {
		0% {
			transform: scale(.99);
		}

		50% {
			transform: scale(1.03);
		}

		100% {
			transform: scale(.99);
		}
	}


	//弹窗样式
	.tc_wrap_logon {
		padding: 30rpx;
		text-align: center;

		.tc_images {
			image {
				width: 300rpx;
				height: 300rpx;
			}
		}

		.tc_info {
			view:nth-child(1) {
				font-weight: bold;
				font-size: 28rpx;
				margin-bottom: 20rpx;
			}

			view:nth-child(2) {
				font-size: 28rpx;
				color: #999;

				span {
					color: #FF611E;
				}
			}
		}

		.tc_btn_box {
			display: flex;
			align-items: center;
			margin-top: 36rpx;
			justify-content: center;

			.tc_btn_huise {
				flex: 1;
				margin-right: 12rpx;
				background: linear-gradient(to right, #F7F7F7, 50%, #F7F7F7);
				border-radius: 200rpx;
				padding: 0 0;
				height: 80rpx !important;
				line-height: 80rpx !important;
				text-align: center;
				color: #333333;
			}

			.tc_btn_huise_err {
				flex: 1;
				background-image: linear-gradient(to right, #FE9400, #FF3D22) !important;
				color: #fff;
				border-radius: 200rpx;
				padding: 0 0;
				height: 80rpx !important;
				line-height: 80rpx !important;
				text-align: center;
			}

			.lijipay {
				flex: 1;
				margin-left: 12rpx;
				position: relative;

				.u-size-default {
					height: 80rpx !important;
					line-height: 80rpx !important;
					background-image: linear-gradient(to right, #FE9400, #FF3D22) !important;
					color: #fff;
				}
			}
		}
	}

	.fanhuiHome {
		border: 1px solid #999999;
		width: 60rpx;
		height: 60rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		border-radius: 200rpx;
		margin-left: 30rpx;
	}

	.kefu_Box {
		position: fixed;
		z-index: 1000;
		z-index: 9992;
		bottom: 290rpx;
		right: 0;
		background-color: #ffffff;
		padding: 10rpx 30rpx 10rpx 10rpx;
		border-radius: 200rpx 0 0 200rpx;
		box-shadow: 0 0 5px rgba(0, 0, 0, 0.10);
		margin: 10px 0 10px 5px; //让出阴影位置

		.kefu_icon {
			width: 70rpx;
			height: 70rpx;
		}

		/deep/ button {
			background-color: transparent !important;
			padding: 0 !important;
			margin: 0 !important;
			line-height: 0 !important;
		}

		/deep/ button::after {
			border: none !important;
		}
	}

	.lanjiazai {
		text-align: center;
		display: flex;
		align-items: center;
		justify-content: center;
		padding-top: 90rpx;
		//height: calc(35vh - 66px);
		color: #999;

		.tag {
			margin-top: 8rpx;
			font-size: 24rpx;
		}

		.loading_icon {
			width: 120rpx;
			height: 120rpx;

			.loading_gif {
				width: 120rpx;
				height: 120rpx;
			}
		}
	}

	@keyframes dialog-fade-in {

		0% {
			opacity: 0;
			//transform: scale(0)
		}

		100% {
			opacity: 1;
			//transform: scale(1);
		}

	}

	/deep/ uni-button:after {
		border: none !important;
	}
	
	.noDatas {
		position: absolute;
		top: 50%;
		left: 50%;
		transform: translate(-50%, -50%);
	}
</style>